<template>
    <el-dialog v-model="dialogFormVisible" :title="title" @close="closeDialog">
        <el-form :model="addBaseAchievementAnalysisSubjectForm" ref="addBaseAchievementAnalysisSubjectRef" :rules="addBaseAchievementAnalysisSubjectrules">
                        <el-form-item label="批次名次" :label-width="formLabelWidth"
                                      prop="name">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.name"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写批次名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="选科类型" :label-width="formLabelWidth"
                                      prop="modeSubject">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.modeSubject"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写选科类型"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="科目" :label-width="formLabelWidth"
                                      prop="subjectName">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.subjectName"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写科目"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班主任" :label-width="formLabelWidth"
                                      prop="teacherName">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.teacherName"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班主任"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="人员编号" :label-width="formLabelWidth"
                                      prop="teacherNumber">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.teacherNumber"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写人员编号"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学年" :label-width="formLabelWidth"
                                      prop="schoolYear">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.schoolYear"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写学年"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="考试名称" :label-width="formLabelWidth"
                                      prop="typeName">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.typeName"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写考试名称"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="年级" :label-width="formLabelWidth"
                                      prop="gradeId" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.gradeId"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写年级"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班级" :label-width="formLabelWidth"
                                      prop="classId" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.classId"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="统考人数" :label-width="formLabelWidth"
                                      prop="countStudent" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countStudent"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写统考人数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="校区" :label-width="formLabelWidth"
                                      prop="campus" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.campus"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写校区"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="总分" :label-width="formLabelWidth"
                                      prop="total" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.total"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写总分"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985指标" :label-width="formLabelWidth"
                                      prop="index985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.index985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985指标"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985完成数" :label-width="formLabelWidth"
                                      prop="countAbove985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countAbove985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985贡献率" :label-width="formLabelWidth"
                                      prop="percentageAbove985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAbove985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985分数线" :label-width="formLabelWidth"
                                      prop="above985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.above985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985分数线"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211指标" :label-width="formLabelWidth"
                                      prop="index211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.index211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211指标"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211完成数" :label-width="formLabelWidth"
                                      prop="countAbove211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countAbove211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211贡献率" :label-width="formLabelWidth"
                                      prop="percentageAbove211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAbove211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211分数线" :label-width="formLabelWidth"
                                      prop="above211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.above211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211分数线"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本指标" :label-width="formLabelWidth"
                                      prop="indexZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.indexZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本指标"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本完成数" :label-width="formLabelWidth"
                                      prop="countAboveZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countAboveZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本贡献率" :label-width="formLabelWidth"
                                      prop="percentageAboveZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAboveZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本分数线" :label-width="formLabelWidth"
                                      prop="aboveZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.aboveZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本分数线"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本指标" :label-width="formLabelWidth"
                                      prop="indexYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.indexYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本指标"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本完成数" :label-width="formLabelWidth"
                                      prop="countAboveYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countAboveYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本贡献率" :label-width="formLabelWidth"
                                      prop="percentageAboveYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAboveYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本分数线" :label-width="formLabelWidth"
                                      prop="aboveYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.aboveYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本分数线"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985总分完成数" :label-width="formLabelWidth"
                                      prop="countTotal985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countTotal985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985总分完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211总分完成数" :label-width="formLabelWidth"
                                      prop="countTotal211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countTotal211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211总分完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本总分完成数" :label-width="formLabelWidth"
                                      prop="countTotalZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countTotalZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本总分完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本总分完成数" :label-width="formLabelWidth"
                                      prop="countTotalYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countTotalYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本总分完成数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985双上线数" :label-width="formLabelWidth"
                                      prop="countDouble985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countDouble985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985双上线数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211双上线数" :label-width="formLabelWidth"
                                      prop="countDouble211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countDouble211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211双上线数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本双上线数" :label-width="formLabelWidth"
                                      prop="countDoubleZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countDoubleZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本双上线数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本双上线数" :label-width="formLabelWidth"
                                      prop="countDoubleYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.countDoubleYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本双上线数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985班级贡献率" :label-width="formLabelWidth"
                                      prop="percentageClass985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageClass985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985班级贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211班级贡献率" :label-width="formLabelWidth"
                                      prop="percentageClass211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageClass211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211班级贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本班级贡献率" :label-width="formLabelWidth"
                                      prop="percentageClassZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageClassZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本班级贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本班级贡献率" :label-width="formLabelWidth"
                                      prop="percentageClassYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageClassYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本班级贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="985平均贡献率" :label-width="formLabelWidth"
                                      prop="percentageAverage985" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAverage985"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写985平均贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="211平均贡献率" :label-width="formLabelWidth"
                                      prop="percentageAverage211" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAverage211"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写211平均贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="重本平均贡献率" :label-width="formLabelWidth"
                                      prop="percentageAverageZd" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAverageZd"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写重本平均贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="一本平均贡献率" :label-width="formLabelWidth"
                                      prop="percentageAverageYb" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageAverageYb"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写一本平均贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学科贡献率" :label-width="formLabelWidth"
                                      prop="percentageSubjectContribution" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageSubjectContribution"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写学科贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班级贡献率" :label-width="formLabelWidth"
                                      prop="percentageClassContribution" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.percentageClassContribution"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级贡献率"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学科排名" :label-width="formLabelWidth"
                                      prop="rankingSubjectContribution" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.rankingSubjectContribution"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写学科排名"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班级排名" :label-width="formLabelWidth"
                                      prop="rankingClassContribution" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.rankingClassContribution"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级排名"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="创建时间" :label-width="formLabelWidth"
                                      prop="createTime" v-if="addBaseAchievementAnalysisSubjectForm.id">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.createTime"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写创建时间"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="计算办法" :label-width="formLabelWidth"
                                      prop="calculationMethod">
                            <el-input
                                    v-model="addBaseAchievementAnalysisSubjectForm.calculationMethod"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写计算办法"
                            ></el-input>
                        </el-form-item>
        </el-form>
        <template #footer>
      <span class="dialog-footer">
        <el-button @click="cancel()">取消</el-button>
        <el-button type="primary" @click="save()">保存</el-button>
      </span>
        </template>
    </el-dialog>
</template>

<script>
    import {ref} from "vue";
    import {httpService} from "@/utils/httpService";
    import {ElMessage, ElForm} from "element-plus";
    import {vxRule} from "@/utils/validator";

    export default {
        name: "AddBaseAchievementAnalysisSubject",
        components: {ElForm, ElMessage},
        data() {
            return {
                dialogFormVisible: ref(false),
                formLabelWidth: "120px",
                title: "",
                personnelType: "",
                addBaseAchievementAnalysisSubjectForm: {
                    name: "",
                    modeSubject: "",
                    subjectName: "",
                    teacherName: "",
                    teacherNumber: "",
                    schoolYear: "",
                    typeName: "",
                    gradeId: "",
                    classId: "",
                    countStudent: "",
                    campus: "",
                    total: "",
                    index985: "",
                    countAbove985: "",
                    percentageAbove985: "",
                    above985: "",
                    index211: "",
                    countAbove211: "",
                    percentageAbove211: "",
                    above211: "",
                    indexZd: "",
                    countAboveZd: "",
                    percentageAboveZd: "",
                    aboveZd: "",
                    indexYb: "",
                    countAboveYb: "",
                    percentageAboveYb: "",
                    aboveYb: "",
                    countTotal985: "",
                    countTotal211: "",
                    countTotalZd: "",
                    countTotalYb: "",
                    countDouble985: "",
                    countDouble211: "",
                    countDoubleZd: "",
                    countDoubleYb: "",
                    percentageClass985: "",
                    percentageClass211: "",
                    percentageClassZd: "",
                    percentageClassYb: "",
                    percentageAverage985: "",
                    percentageAverage211: "",
                    percentageAverageZd: "",
                    percentageAverageYb: "",
                    percentageSubjectContribution: "",
                    percentageClassContribution: "",
                    rankingSubjectContribution: "",
                    rankingClassContribution: "",
                    createTime: "",
                    calculationMethod: "",
                },
                // 校验规则
                addBaseAchievementAnalysisSubjectrules: {
                    name: vxRule(true, null, "blur"),
                    modeSubject: vxRule(true, null, "blur"),
                    subjectName: vxRule(true, null, "blur"),
                    teacherName: vxRule(true, null, "blur"),
                    teacherNumber: vxRule(true, null, "blur"),
                    schoolYear: vxRule(true, null, "blur"),
                    typeName: vxRule(true, null, "blur"),
                    calculationMethod: vxRule(true, null, "blur"),
                },
            };
        },
        methods: {
            closeDialog() {
                this.clear();
            },
            cancel() {
                this.dialogFormVisible = false;
                this.clear();
            },
            getBaseAchievementAnalysisSubjectById(id) {
                httpService("/api/baseAchievementAnalysisSubject/queryById", {id: id}, "get").then(
                    (data) => {
                        this.addBaseAchievementAnalysisSubjectForm = data;
                    }
                );
            },
            clear() {
                this.dialogFormVisible = false;
                //清空form
                    this.addBaseAchievementAnalysisSubjectForm.id = "";
                    this.addBaseAchievementAnalysisSubjectForm.name = "";
                    this.addBaseAchievementAnalysisSubjectForm.modeSubject = "";
                    this.addBaseAchievementAnalysisSubjectForm.subjectName = "";
                    this.addBaseAchievementAnalysisSubjectForm.teacherName = "";
                    this.addBaseAchievementAnalysisSubjectForm.teacherNumber = "";
                    this.addBaseAchievementAnalysisSubjectForm.schoolYear = "";
                    this.addBaseAchievementAnalysisSubjectForm.typeName = "";
                    this.addBaseAchievementAnalysisSubjectForm.gradeId = "";
                    this.addBaseAchievementAnalysisSubjectForm.classId = "";
                    this.addBaseAchievementAnalysisSubjectForm.countStudent = "";
                    this.addBaseAchievementAnalysisSubjectForm.campus = "";
                    this.addBaseAchievementAnalysisSubjectForm.total = "";
                    this.addBaseAchievementAnalysisSubjectForm.index985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countAbove985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAbove985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.above985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.index211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countAbove211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAbove211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.above211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.indexZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.countAboveZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAboveZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.aboveZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.indexYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.countAboveYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAboveYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.aboveYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.countTotal985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countTotal211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countTotalZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.countTotalYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.countDouble985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countDouble211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.countDoubleZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.countDoubleYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageClass985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageClass211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageClassZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageClassYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAverage985 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAverage211 = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAverageZd = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageAverageYb = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageSubjectContribution = "";
                    this.addBaseAchievementAnalysisSubjectForm.percentageClassContribution = "";
                    this.addBaseAchievementAnalysisSubjectForm.rankingSubjectContribution = "";
                    this.addBaseAchievementAnalysisSubjectForm.rankingClassContribution = "";
                    this.addBaseAchievementAnalysisSubjectForm.createTime = "";
                    this.addBaseAchievementAnalysisSubjectForm.calculationMethod = "";
            },
            save() {
                this.$refs.addBaseAchievementAnalysisSubjectRef.validate((valid) => {
                    if (valid) {
                        let params = new FormData(); //创建一个form对象,必须是form对象否则后端接受不到数据
                        params.append("name", this.addBaseAchievementAnalysisSubjectForm.name);
                        params.append("modeSubject", this.addBaseAchievementAnalysisSubjectForm.modeSubject);
                        params.append("subjectName", this.addBaseAchievementAnalysisSubjectForm.subjectName);
                        params.append("teacherName", this.addBaseAchievementAnalysisSubjectForm.teacherName);
                        params.append("teacherNumber", this.addBaseAchievementAnalysisSubjectForm.teacherNumber);
                        params.append("schoolYear", this.addBaseAchievementAnalysisSubjectForm.schoolYear);
                        params.append("typeName", this.addBaseAchievementAnalysisSubjectForm.typeName);
                        params.append("gradeId", this.addBaseAchievementAnalysisSubjectForm.gradeId);
                        params.append("classId", this.addBaseAchievementAnalysisSubjectForm.classId);
                        params.append("countStudent", this.addBaseAchievementAnalysisSubjectForm.countStudent);
                        params.append("campus", this.addBaseAchievementAnalysisSubjectForm.campus);
                        params.append("total", this.addBaseAchievementAnalysisSubjectForm.total);
                        params.append("index985", this.addBaseAchievementAnalysisSubjectForm.index985);
                        params.append("countAbove985", this.addBaseAchievementAnalysisSubjectForm.countAbove985);
                        params.append("percentageAbove985", this.addBaseAchievementAnalysisSubjectForm.percentageAbove985);
                        params.append("above985", this.addBaseAchievementAnalysisSubjectForm.above985);
                        params.append("index211", this.addBaseAchievementAnalysisSubjectForm.index211);
                        params.append("countAbove211", this.addBaseAchievementAnalysisSubjectForm.countAbove211);
                        params.append("percentageAbove211", this.addBaseAchievementAnalysisSubjectForm.percentageAbove211);
                        params.append("above211", this.addBaseAchievementAnalysisSubjectForm.above211);
                        params.append("indexZd", this.addBaseAchievementAnalysisSubjectForm.indexZd);
                        params.append("countAboveZd", this.addBaseAchievementAnalysisSubjectForm.countAboveZd);
                        params.append("percentageAboveZd", this.addBaseAchievementAnalysisSubjectForm.percentageAboveZd);
                        params.append("aboveZd", this.addBaseAchievementAnalysisSubjectForm.aboveZd);
                        params.append("indexYb", this.addBaseAchievementAnalysisSubjectForm.indexYb);
                        params.append("countAboveYb", this.addBaseAchievementAnalysisSubjectForm.countAboveYb);
                        params.append("percentageAboveYb", this.addBaseAchievementAnalysisSubjectForm.percentageAboveYb);
                        params.append("aboveYb", this.addBaseAchievementAnalysisSubjectForm.aboveYb);
                        params.append("countTotal985", this.addBaseAchievementAnalysisSubjectForm.countTotal985);
                        params.append("countTotal211", this.addBaseAchievementAnalysisSubjectForm.countTotal211);
                        params.append("countTotalZd", this.addBaseAchievementAnalysisSubjectForm.countTotalZd);
                        params.append("countTotalYb", this.addBaseAchievementAnalysisSubjectForm.countTotalYb);
                        params.append("countDouble985", this.addBaseAchievementAnalysisSubjectForm.countDouble985);
                        params.append("countDouble211", this.addBaseAchievementAnalysisSubjectForm.countDouble211);
                        params.append("countDoubleZd", this.addBaseAchievementAnalysisSubjectForm.countDoubleZd);
                        params.append("countDoubleYb", this.addBaseAchievementAnalysisSubjectForm.countDoubleYb);
                        params.append("percentageClass985", this.addBaseAchievementAnalysisSubjectForm.percentageClass985);
                        params.append("percentageClass211", this.addBaseAchievementAnalysisSubjectForm.percentageClass211);
                        params.append("percentageClassZd", this.addBaseAchievementAnalysisSubjectForm.percentageClassZd);
                        params.append("percentageClassYb", this.addBaseAchievementAnalysisSubjectForm.percentageClassYb);
                        params.append("percentageAverage985", this.addBaseAchievementAnalysisSubjectForm.percentageAverage985);
                        params.append("percentageAverage211", this.addBaseAchievementAnalysisSubjectForm.percentageAverage211);
                        params.append("percentageAverageZd", this.addBaseAchievementAnalysisSubjectForm.percentageAverageZd);
                        params.append("percentageAverageYb", this.addBaseAchievementAnalysisSubjectForm.percentageAverageYb);
                        params.append("percentageSubjectContribution", this.addBaseAchievementAnalysisSubjectForm.percentageSubjectContribution);
                        params.append("percentageClassContribution", this.addBaseAchievementAnalysisSubjectForm.percentageClassContribution);
                        params.append("rankingSubjectContribution", this.addBaseAchievementAnalysisSubjectForm.rankingSubjectContribution);
                        params.append("rankingClassContribution", this.addBaseAchievementAnalysisSubjectForm.rankingClassContribution);
                        params.append("createTime", this.addBaseAchievementAnalysisSubjectForm.createTime);
                        params.append("calculationMethod", this.addBaseAchievementAnalysisSubjectForm.calculationMethod);
                        if (this.addBaseAchievementAnalysisSubjectForm.id) {
                            params.append("id", this.addBaseAchievementAnalysisSubjectForm.id);
                            httpService("/api/baseAchievementAnalysisSubject/edit", params, "post").then(
                                (data) => {
                                    if (data.code == 200) {
                                        ElMessage.success("修改成功");
                                        this.clear();
                                        //刷新父组件的数据
                                        this.$parent.getBaseAchievementAnalysisSubjectList();
                                    } else {
                                        ElMessage.error("修改失败");
                                    }
                                }
                            );
                        } else {
                            httpService("/api/baseAchievementAnalysisSubject/add", params, "post").then(
                                (data) => {
                                    if (data.code == 200) {
                                        ElMessage.success("添加成功");
                                        this.clear();
                                        //刷新父组件的数据
                                        this.$parent.getBaseAchievementAnalysisSubjectList();
                                    } else {
                                        ElMessage.error("添加失败");
                                    }
                                }
                            );
                        }
                    } else {
                        return false;
                    }
                });
            },
        },
    };
</script>
<style>
</style>